package com.dullwolf.cmd.osu;

import com.dullwolf.cmd.Command;
import com.dullwolf.utils.CmdUtil;
import com.dullwolf.utils.osu.OSUApi;
import com.jfinal.kit.StrKit;

public class OsuHomeCommand extends Command {

    @Override
    public void execute() {

    }


    public void executeOsuHome(long userId, long id, int type, String params,int num,int mode) {
        String osuName = CmdUtil.reset(userId, id, type, CmdUtil.getParams(params, num));
        if (StrKit.notBlank(osuName)) {
            try {
                int ll = 0, pc = 0, tth = 0;
                String ranks = "↑0", accs = "+0", pps = "+0", rankeds = "+0";
                String msg = new OSUApi().sendOsuApi(osuName, ll, pc, tth, ranks, accs, pps, rankeds, mode,false);
                if (null != msg) {
                    CmdUtil.sendMessage(msg, id, type);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }


}
